package com.example.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.domain.Result;
import com.example.dao.AccountDao;
import com.example.domain.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountServiceImpl extends ServiceImpl<AccountDao, Account> implements AccountService {
    @Autowired
    AccountDao accountDao;

    @Override
    public Result save1 (Account account) {
       return new Result(accountDao.insert(account) > 0);
    }
    @Override
    public Result haveAccount(String account){
        Account account1 = accountDao.selectById(account);
        if(account1 == null){
          return new Result(true);
        }
        return new Result(false);
    }
}
